package com.common.help.test18;

import java.util.Date;

public class MyFolder {
    //文件夹名称
    private String name;
    
    //创建时间
    private Date createtime;
        
    //上级文件夹
    private MyFolder parent;
    
    //包含的文件
    private MyFile[] files;
    
    //包含的子文件夹
    private MyFolder[] subFolders;
    
    
    public int getTotalSize(){
    	int totalSize = 0;
    	if(files!=null){
	    	for(MyFile file:files){
	    		totalSize +=file.getSize();
	    	}
    	}
    	if(subFolders!=null){
	    	for(MyFolder myFolder : subFolders){
	    		totalSize += myFolder.getTotalSize();
	    	}
    	}
    	return totalSize;
    }
    
    //其他方法...
}